<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>随机颜色</title>
    <script src="https://unpkg.com/@tailwindcss/browser@4"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
</head>
<body class="flex flex-col items-center justify-center h-screen bg-gray-100">
    <button id="colorButton" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded transition duration-300">
        点击生成随机颜色
    </button>
    <script>
        const colorButton = document.getElementById('colorButton');
        function getRandomInt() {
            return Math.floor(Math.random() * 256);
        }
        colorButton.addEventListener('click', () => {
            const r = getRandomInt();
            const g = getRandomInt();
            const b = getRandomInt();
            document.body.style.backgroundColor = `rgb(${r}, ${g}, ${b})`;
        });
    </script>
</body>
</html>
    